<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>配置列表</title>
    <link rel="stylesheet" type="text/css" th:href="@{/static/css/basic.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/static/css/index.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/static/css/topAndBottom.css}">
    <script type="text/javascript" th:src="@{/webjars/jquery/3.1.1/jquery.js}"></script>
    <script type="text/javascript">
        function fieldDel(id) {
            $.ajax({
                url: "/web/etl/fieldDel.do?id=" + id,
                type: "GET",
                dataType: "json",
                success: function (result) {
                    if (result.code == 1000) {
                        $("#tr_" + id).remove();
                        alert('删除成功');
                    } else {
                        alert(result.msg);
                    }
                }
            });
        }

        function addAll() {
            $.ajax({
                url: "/web/etl/addAll.do?entityId=${entityId}",
                type: "POST",
                dataType: "json",
                success: function (result) {
                    if (result.code == 1000) {
                        alert('添加成功');
                    } else {
                        alert(result.msg);
                    }
                }
            });
        }
    </script>
</head>
<body>

<div class="content clearfloat">
    <div class="content_right fr">
        <div class="first clearfloat">
            <div class="fl title">
                <a class="title" href="javascript:history.go(-1);"></a> 配置列表
            </div>
            <div class="fr operation">
                <span><a href="/web/etl/fieldList.do?entityId=${entityId}" target="rightFrame"> <img th:src="@{/static/img/flush.png}">刷新</a></span>
                <span><a href="/web/etl/fieldEdit.do?entityId=${entityId}" target="rightFrame"> <img th:src="@{/static/img/zengjia.png}">新增</a></span>
            </div>
        </div>
        <div class="third">
            <table>
                <tr>
                    <th width="4%">序号</th>
                    <th width="15%">项目名称</th>
                    <th width="15%">app名称</th>
                    <th width="12%">创建时间</th>
                    <th style="text-align: center;">操作</th>
                </tr>

                <tr th:each="apollo,iterStat : ${apollos}">
                    <td th:text="${apollo.id}"></td>
                    <td th:text="${apollo.projectName}"></td>
                    <td th:text="${apollo.appName}"></td>
                    <td th:text="${#dates.format(apollo.createTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
                    <td style="text-align: center;">
                        <span><a href="javascript:fieldDel('');"><img th:src="@{/static/img/delete.png}">删除</a></span>
                    </td>
                </tr>
            </table>
            <div class="fenye">
                <ul class="fy_ul">
                    <li class="fy_li_first">共 [[${count}]] 条记录</li>
                    <li th:if="${currPage} > 1"><a th:href="@{/web/apollo/page(page=${currPage - 1})}">上一页</a></li>
                    <li id="currPage" th:text="${currPage}"></li>
                    <li th:if="${currPage < totalPage}"><a th:href="@{/web/apollo/page(page=${currPage + 1})}">下一页</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
</body>
</html>